<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<title>我的</title>
	<link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/common.css" />
		<link rel="stylesheet" type="text/css" href="../../css/aui.css" />

    <style>
    	html, body {width: 100%;min-height: 100%;background: #fff;}
    	.h20 {height: 0.5rem;background: #f0f0f0;}
		.h1 {height: 1px;background: #f0f0f0;}

		.firstblock, .secondblock, .thirdblock {background-color: #fff;}
		/* 头部登陆 */
		.login {height:240px;background-color:#2997e4;/*background-image: url(../../image/personal_bkg.jpg);background-repeat: no-repeat; background-size: cover;*/position: relative;}
	.login .personal_logo {width: 4rem;height: 4rem;border-radius: 50%;margin: 0 auto 9px;/*position: absolute; top: 60px; left: 20px;*/}
		.login .userinfo {position: absolute; top: 60px;text-align: center; left: 0; right: 0;}
		.login .userinfo .title {font-size: 0.8rem; color: #fff;}

		/* 设置条目 */
		.item {height: 3rem;line-height: 3rem;padding-left: 0.7rem;background-color: #fff;}
		.item_ico {float: left;width: 2.3rem;padding: 0.7rem 0.7rem 0.7rem 0;}
		.item_arrow {float: right;width: 1.5rem;padding: 1rem 0.7rem 1rem 0;}
		.item span {font-size: 0.7rem;}
		.header_fixed {
			background: #2997e4;
			height: 24px;
			position: fixed;
			top: 0;
			width: 100%;
			z-index: 99
		}
    </style>
</head>
<body>
	<div id="app" v-cloak>
	<div class="header_fixed"></div>
	<div class="login"  tapmode="">
		<!-- <img src="../../image/personal_bkg.jpg" alt="" class="loginbg"> -->
		<div class="userinfo" v-if="token" >
			<div v-if="data.headImg" class="personal_logo" :style="'background: url('+ data.headImg +') center/cover no-repeat'"></div>
			<div v-else class="personal_logo" style="background: url(../../image/wdr@3x.png) center/cover no-repeat"></div>
			<div class="title">{{data.nickname}}</div>
		</div>
		<div class="userinfo" v-else onclick="openLogin()">
			<div class="personal_logo" style="background: url(../../image/profile_default.png) center/cover no-repeat"></div>
			<div class="title">点击登录</div>
		</div>

	</div>



	<!-- 第一块 -->
	<div class="firstblock">
		<div class="item" tapmode="presshover" onclick="openWindow('myorder','我的收藏')">
			<img src="../../image/sc@3x.png" alt="" class="item_ico">
			<span>我的收藏</span>
			<img src="../../image/arrow.png" alt="" class="item_arrow">
		</div><div class="h1"></div>
		<div class="item" tapmode="presshover" onclick="openNewWindow('myregistration','我的报名')">
			<img src="../../image/bm@3x.png" alt="" class="item_ico">
			<span>我的报名</span>
			<img src="../../image/arrow.png" alt="" class="item_arrow">
		</div><div class="h1"></div>
		<div class="item" tapmode="presshover" onclick="openNewWindow('mydeclare','我的申报')">
			<img src="../../image/sb@3x.png" alt="" class="item_ico">
			<span>我的申报</span>
			<img src="../../image/arrow.png" alt="" class="item_arrow">
		</div><div class="h1"></div>
		<div class="item" tapmode="presshover" onclick="">
			<img src="../../image/myxx@3x.png" alt="" class="item_ico">
			<span>我的积分</span>
			<img src="../../image/arrow.png" alt="" class="item_arrow">
		</div><div class="h1"></div>
		<div class="item" tapmode="presshover" onclick="openNewWindow('mylearn','我的学会')">
			<img src="../../image/xh@3x.png" alt="" class="item_ico">
			<span>我的学会</span>
			<img src="../../image/arrow.png" alt="" class="item_arrow">
		</div><div class="h1"></div>
		<div class="item" tapmode="presshover" onclick="openNewWindow('myrelease','我的发布')">
			<img src="../../image/fb@3x.png" alt="" class="item_ico">
			<span>我的发布</span>
			<img src="../../image/arrow.png" alt="" class="item_arrow">
		</div><div class="h1"></div>
		<div class="item" tapmode="presshover" onclick="openNewWindow('mystudy','我的学习')">
			<img src="../../image/wdxx@3x.png" alt="" class="item_ico">
			<span>我的学习</span>
			<img src="../../image/arrow.png" alt="" class="item_arrow">
		</div>
	</div>


	<!-- 第二块 -->
	<div class="h20"></div>
	<div class="secondblock">
		<div class="item" tapmode="presshover" onclick="openNewWindow('personaldata','个人资料')">
			<img src="../../image/grzl@3x.png" alt="" class="item_ico">
			<span>个人资料</span>
			<img src="../../image/arrow.png" alt="" class="item_arrow">
		</div><div class="h1"></div>
		<div class="item" tapmode="presshover" onclick="openNewWindow('myintegral','设置')">
			<img src="../../image/sz@3x.png" alt="" class="item_ico">
			<span>设置</span>
			<img src="../../image/arrow.png" alt="" class="item_arrow">
		</div><div class="h1"></div>
		<div class="item" tapmode="presshover" onclick="openNewWindow('advicefeedback','意见反馈')">
			<img src="../../image/yjfk@3x.png" alt="" class="item_ico">
			<span>意见反馈</span>
			<img src="../../image/arrow.png" alt="" class="item_arrow">
		</div><div class="h1"></div>
		<div class="item" tapmode="presshover" onclick="openNewWindow('about','关于我们')">
			<img src="../../image/gyqm@3x.png" alt="" class="item_ico">
			<span>关于我们</span>
			<img src="../../image/arrow.png" alt="" class="item_arrow">
		</div>
	</div>



	<div class="h20"></div>
</div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/utils.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/vue.min.js"></script>
<script type="text/javascript">

apiready = function() {
	var app = new Vue({
		el: '#app',
		data: {
			data: [],
			datauser: [],
			token: ''
		},
		created: function() {
			var $_this = this;
			$_this.token = $api.getStorage('token') || '';
			$_this.Login()

			// api.alert({ msg: JSON.stringify($_this.userInfo.nickname) });
		},
		methods: {
			 Login: function() {
				 var $_this = this;
					 if($_this.token == ''){
						 return;
					 }
				 api.ajax({
					url: window.Url.getUsers,
					method: 'GET',
					headers: {
						'baseParams':$_this.token
					},
					timeout: 300,
				}, function(ret, err) {
						if (ret) {
							// api.alert({ msg: JSON.stringify(ret) });
							if (ret.code == 2) {
                  $api.rmStorage('token')
                  $api.rmStorage('data')
									$_this.token = '';
                } else if (ret.code == 0) {
								$api.setStorage('data', ret.data)
								$_this.data = ret.data
							} else {
								api.alert({ msg: ret.message });
							}
						} else {
								api.alert({ msg: JSON.stringify(err) });
						}
				})
			}
		}
	})
}
	function openNewWindow(type,title)
	{
		api.openWin({
			reload:true,
			name: type,
			url: './forth_header.html',
			pageParam: {name: type,title: title},
			bounces: false,
			delay:200
		});
	}

	function openWindow(type,title)
	{
		api.openWin({
			reload:true,
			name: type,
			url: './'+ type +'.html',
			pageParam: {name: type,title: title},
			bounces: false,
			delay:200
		});
	}

	function openLogin()
	{
		api.openWin({
			reload:true,
			name: 'login',
			url: './login_header.html',
			bounces: false,
			delay:200
		});
	}
</script>
</html>
